using System;
using System.Web.UI.WebControls;
using Sedna.Core.Tiles.Contents;

namespace Sedna.Core.Controls
{
	/// <summary>
	/// Summary description for DoubleSubmitStamp.
	/// </summary>
	public class DoubleSubmitStamp : WebControl, IContent
	{
		private static object sync = new Object();
		private static long counter = 0;

		private String contentPlaceHolderId;

		public String ContentPlaceHolderId
		{
			get { return contentPlaceHolderId;}
			set { contentPlaceHolderId = value;}
		}

		protected override void Render(System.Web.UI.HtmlTextWriter writer)
		{
			base.Render(writer);
			long localCounter;
			lock(sync)
			{
				localCounter = ++ counter;
			}
			writer.Write(String.Format("<input name=\"dblsubmitstamp\" type=\"hidden\" value=\"{0}\"/>", localCounter));
		}

	}
}
